package com.saltlux.tdd.algorithm;

import org.junit.Assert;
import org.junit.Test;

public class SwapTester {
	
	@Test
	public void simpleTest(){
		
		int [] swapTest = new int[]{2,3,1};		
		Swap swap = new Swap();
		swap.swap(swapTest, 0, 1);
		
		Assert.assertArrayEquals(new int[]{3,2,1} ,swapTest);
		
	}
	@Test
	public void stringSimpleTest(){
		
		String [] swapTest = new String[]{"a","b","c"};
		Swap swap = new Swap();
		swap.swap(swapTest, 0, 1);
		
		Assert.assertArrayEquals(new String[]{"b","a","c"}, swapTest);
	}
	@Test
	public void doubleSimpleTest(){
		
		Double [] swapTest = new Double[]{1D, 2D, 3D, 4D};
		Swap swap = new Swap();
		swap.swap(swapTest, 0, 1);
		
		Assert.assertArrayEquals(new Double[]{2D, 1D, 3D, 4D}, swapTest);
	}
}
